<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('设备配置')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-config-edit" th:object="${deviceConfig}">
            <input name="configId" th:field="*{configId}" type="hidden">
            <input name="deviceId" th:field="*{deviceId}" type="hidden">
            <div class="panel panel-default">
                <div class="panel-heading">
                    Sharker settings
                </div>
                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Shaker name：</label>
                        <div class="col-sm-8">
                            <input name="shakerName" th:field="*{shakerName}" class="form-control" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">IP Adress：</label>
                        <div class="col-sm-8">
                            <input name="ipAddr" th:field="*{ipAddr}" class="form-control" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Subnet Mask：</label>
                        <div class="col-sm-8">
                            <input name="subnetMask" th:field="*{subnetMask}" class="form-control" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Gateway：</label>
                        <div class="col-sm-8">
                            <input name="gateway" th:field="*{gateway}" class="form-control" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Port：</label>
                        <div class="col-sm-8">
                            <input name="port" th:field="*{port}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    Modbus Port settings
                </div>
                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Modbus ID：</label>
                        <div class="col-sm-8">
                            <input name="modbusId" th:field="*{modbusId}" class="form-control" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Baud rate：</label>
                        <div class="col-sm-8">
                            <input name="baudRate" th:field="*{baudRate}" class="form-control" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Data bits：</label>
                        <div class="col-sm-8">
                            <input name="dataBits" th:field="*{dataBits}" class="form-control" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Parity：</label>
                        <div class="col-sm-8">
                            <input name="parity" th:field="*{parity}" class="form-control" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">Stop bits：</label>
                        <div class="col-sm-8">
                            <input name="stopBits" th:field="*{stopBits}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "device/config";
        $("#form-config-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-config-edit').serialize());
            }
        }
    </script>
</body>
</html>